package java56_7;

//类的骨架用接口来组成
public class Printer {
	private String brand;
	private int price;

	// 包含纸张和墨水的接口
	private Paper paper;
	private Ink ink;

	public void print(String str) {
		System.out.println("用" + ink.getColor() + "来打印");
		System.out.println("打印在" + paper.getSize() + "上");
		System.out.println(str);
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public void setPaper(Paper paper) {
		this.paper = paper;
	}

	public void setInk(Ink ink) {
		this.ink = ink;
	}
}
